﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Project.Domain.AggregateModels;
using System;
using System.Collections.Generic;
using System.Text;

namespace Project.Infrastructure.Models.Mapping
{
    public class ProjectVisibleRuleMap
         : IEntityTypeConfiguration<ProjectVisibleRule>
    {
        public void Configure(EntityTypeBuilder<ProjectVisibleRule> builder)
        {
            //Table.
            builder.ToTable("ProjectVisibleRule");
            //Key.
            builder.HasKey("Id");
            //Properties.
            builder.Property(t => t.Id)
                .HasColumnName("Id")
                .IsRequired();
            builder.Property(t => t.ProjectId)
               .HasColumnName("ProjectId")
               .IsRequired();
            builder.Property(t => t.Tags)
               .HasColumnName("Tags")
               .HasMaxLength(255)
               .IsRequired();
            //Relations
        }
    }
}
